JiGeng,吉耿
创建时间:2022年6月27日 08:28
编辑时间:2022年6月27日 08:31
django.db.utils.OperationalError: FATAL: Ident authentication failed for user "p
解决思路:处理数据库的管控权限注册表。按照最小需求原则修改。
解决办法:
修改postgresql配置文件:
sudo vi /var/lib/pgsql/9.6/data/pg_hba.conf
将peer或者ident改为trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
#host all all 127.0.0.1/32 ident
host all all 127.0.0.1/32 trust
# IPv6 local connections:
#host all all ::1/128 ident
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication postgres trust
host replication postgres 127.0.0.1/32 trust
host replication postgres ::1/128 trust
重启postgresql
service postgresql restart
重新执行migrate